import request from '@/utils/request'

//获取小程序签天数和签到按钮是否可签
export function listIsSign(data) {
  return request({
    url: 'signIn/listIsSign',
    method: 'post',
    data,
    urlType: 2
  })
}

// 获取小程序签到列表查询
export function listHandle(data) {
  return request({
    url: 'signIn/listWx',
    method: 'post',
    data,
    urlType: 2
  })
}

// 签到设置管理-添加
export function signInAdd(data) {
  return request({
    url: 'signInRecord/add',
    method: 'post',
    data,
    urlType: 2
  })
}

// 签到设置管理-添加
export function signInRecordList(data) {
  return request({
    url: 'signInRecord/list',
    method: 'post',
    data,
    urlType: 2
  })
}

//新增
export function usersPutHandle(data) {
  return request({
    url: 'users',
    method: 'put',
    data
  })
}

//新增
export function getUserHandle(data) {
  return request({
    url: 'users/getUser',
    method: 'get',
    data,
    urlType: 2
  })
}

//新增
export function myPointsHandle(data) {
  return request({
    url: 'exchangeRecords/myPoints',
    method: 'post',
    data,
    urlType: 2
  })
}

//信息认证
export function synchronousUserInfoHandle(data) {
  return request({
    url: 'users/synchronousUserInfo',
    method: 'post',
    data,
    urlType: 2
  })
}

//修改用户头像
export function updateUserProfile(data) {
  return request({
    url: 'users/updateUserProfile',
    method: 'post',
    data,
    urlType: 2
  })
}

//意见反馈
export function saveFeedback(data) {
  return request({
    url: 'feedback/saveFeedback',
    method: 'post',
    data
  })
}

//获取积分规则内容
export function getRule(data) {
  return request({
    url: 'ruleSettings/getRule',
    method: 'get',
    data
  })
}

//工资查询
export function getHourlyWageInfo(data) {
  return request({
    url: 'users/getHourlyWageInfo',
    method: 'post',
    data
  })
}

//年假查询
export function getAnnualLeaveInfo(data) {
  return request({
    url: 'users/getAnnualLeaveInfo',
    method: 'post',
    data
  })
}

//工时查询
export function getWorkingHoursInfo(data) {
  return request({
    url: 'users/getWorkingHoursInfo',
    method: 'post',
    data
  })
}

//修改密码
export function changePassword(data) {
  return request({
    url: 'users/changePassword',
    method: 'post',
    data,
    urlType: 2
  })
}

//获取验证码
export function getMobileCode(data) {
  return request({
    url: 'users/shortMessageCode',
    method: 'post',
    data,
    urlType: 2
  })
}

//判断用户扫用户的二维码的检查
export function checkIdExists(data) {
  return request({
    url: 'shop/checkIdExists',
    method: 'post',
    data,
    urlType: 2
  })
}

export default {
  listIsSign,
  listHandle,
  signInAdd,
  signInRecordList,
  usersPutHandle,
  myPointsHandle,
  getUserHandle,
  synchronousUserInfoHandle,
  updateUserProfile,
  saveFeedback,
  getRule,
  getHourlyWageInfo,
  getAnnualLeaveInfo,
  getWorkingHoursInfo,
  changePassword,
  getMobileCode,
  checkIdExists
}
